//
//  ListViewController.m
//  MMWMiotLinkDemo
//
//  Created by 程杰 on 2020/12/30.
//  Copyright © 2020 HGG. All rights reserved.
//

#import "ListViewController.h"
#import <CoreLocation/CoreLocation.h>
@interface ListViewController ()
@property (nonatomic,strong) CLLocationManager *manager;
@end

@implementation ListViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self checkOpenLocationOrNot];
}

//判断是否开启了地理位置信息
- (BOOL)checkOpenLocationOrNot
{
    CLAuthorizationStatus status = [CLLocationManager authorizationStatus];
    if (kCLAuthorizationStatusDenied == status || kCLAuthorizationStatusRestricted == status || kCLAuthorizationStatusNotDetermined == status) {
        
        self.manager = [[CLLocationManager alloc]init];
        [self.manager requestAlwaysAuthorization];
        
        return NO;
    }
    return YES;
}
//判断iOS13根据地理位置返回能否返回WiFiSSid
- (BOOL)canGetWifiSSid {
    if (@available(iOS 13.0, *)) {
        return [self checkOpenLocationOrNot];
    }
    return YES;
}
@end
